package com.zero.test3;

public class Mater {
    void feed(Animal a){
        a.eat();
        a.drink();
        if (a instanceof Dog d){
            d.swim();
        }
    }

    void feed(Dog d){
        d.setName("小黑");
        System.out.println(d.getName());
        d.eat();
        d.swim();
    }
}
